package com.wc.alorithm_luogu.P1364;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

/**
 * @Author congege
 * @Description First Step (ファーストステップ)
 * https://www.luogu.com.cn/problem/P3654
 * @Date Created in 2023/9/22-15:20
 */
public class Main {
    public static void main(String[] args) {
        Input scan = new Input();
        int r = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        char[][] map = new char[r][c];
        for (int i = 0; i < r; i++) {
            map[i] = scan.next().toCharArray();
        }

        /**
         * 横着寻找
         */
        int curBlockNumber = 0;
        int ans = 0;

        for (int i = 0; i < r; i++) {
            for (int j = 0; j < c; j++) {
                if (map[i][j] == '.') {
                    curBlockNumber++;
                    if (curBlockNumber >= k) {
                        ans++;
                    }
                } else {
                    curBlockNumber = 0;
                }
            }
            curBlockNumber = 0;
        }

        for (int i = 0; i < c; i++) {
            for (int j = 0; j < r; j++) {
                if (map[j][i] == '.') {
                    curBlockNumber++;
                    if (curBlockNumber >= k) {
                        ans++;
                    }
                } else {
                    curBlockNumber = 0;
                }
            }
            curBlockNumber = 0;
        }
        if (k == 1) {
            System.out.println(ans / 2);
        } else {
            System.out.println(ans);
        }
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }

        public String next() {
            try {
                /**
                 * 初始中sval里面只有a-z A-z
                 * 要将. # 填入还不能有其他的含义
                 * 就瑶将.恢复成原始含义
                 */
                in.ordinaryChar('.');
                in.wordChars('.', '.');
                in.wordChars('#', '#');
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return in.sval;
        }
    }
}
